.Lrestore_iret_guest:
.Lft5: iret
.section .fixup,"ax"
-.Lfx1: subl $28,%esp
- pushl 28(%esp) # error_code/entry_vector
- movl %eax,UREGS_eax+4(%esp)
- movl %ebp,UREGS_ebp+4(%esp)
- movl %edi,UREGS_edi+4(%esp)
- movl %esi,UREGS_esi+4(%esp)
- movl %edx,UREGS_edx+4(%esp)
- movl %ecx,UREGS_ecx+4(%esp)
- movl %ebx,UREGS_ebx+4(%esp)
- sti
- popl %esi
+.Lfx1: sti
+ SAVE_ALL_GPRS
+ mov UREGS_error_code(%esp),%esi
pushfl # EFLAGS
movl $__HYPERVISOR_CS,%eax
pushl %eax # CS
#define ASSERT_INTERRUPTS_ENABLED ASSERT_INTERRUPT_STATUS(nz)
#define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
+#define SAVE_ALL_GPRS \
+ cld; \
+ pushl %eax; \
+ pushl %ebp; \
+ SETUP_EXCEPTION_FRAME_POINTER; \
+ pushl %edi; \
+ pushl %esi; \
+ pushl %edx; \
+ pushl %ecx; \
+ pushl %ebx
+
/*
* Saves all register state into an exception/interrupt stack frame.
* Returns to the caller at <xen_lbl> if the interrupted context is within
* the caller is reponsible for validity of %ds/%es.
*/
#define SAVE_ALL(xen_lbl, vm86_lbl) \
- cld; \
- pushl %eax; \
- pushl %ebp; \
- SETUP_EXCEPTION_FRAME_POINTER; \
- pushl %edi; \
- pushl %esi; \
- pushl %edx; \
- pushl %ecx; \
- pushl %ebx; \
+ SAVE_ALL_GPRS; \
testl $(X86_EFLAGS_VM),UREGS_eflags(%esp); \
mov %ds,%edi; \
mov %es,%esi; \